Exercise: Deduce the Outputs

In this lesson, your concepts will be evaluated through a quiz.

Choose one correct answer.

15

What will the following loop print out?

for i := 0; i<7 ; i++ {
    if i%2 == 0 { continue }
    fmt.Println("Odd:", i)
}
Your Answer
A)

Odd: 1

Odd: 3

Odd: 5

B)

Infinite loop

C)

Odd: 0

Odd: 2

Odd: 4

D)

None of the above

Question 15 of 1515 attempted

We hope that you performed well in the quiz. That’s it about functions and their uses in Golang. In the next chapter, we’ll discuss functions.

Use of Labels - goto

Introduction to Functions